<?php

class Exam_Form_Admin_Faqcategory_AddFaq extends Engine_Form
{
    public function init() 
    {
        $this
                ->setTitle('EXAM_TITLE_FORM_ADD_FAQ')
                ->setDescription('');

                //init country
        $cats = Exam_Model_DbTable_Faqcategories::getAllFaqcategories();
        $catsOptions = array();
        foreach ($cats as $cat) {
            $catsOptions[$cat['faqcategory_id']] = $cat['faqcategory_name'];
        }

        $this->addElement('Select', 'faqcategory_id', array(
                'label' => 'Category',
                'multiOptions' => $catsOptions
        ));
        
        $this->addElement('text', 'question', array(
            'label' => 'Question',
            'allowEmpty' => false,
            'required' => true
                ));
        $this->addElement('TinyMce', 'answer', array(
	      'label' => 'Answer',
	      'required' => true,
	      'allowEmpty' => false,
	    ));
	            
        $this->addElement('button', 'submit', array(
            'type' => 'submit',
            'label' => 'Add',
            'decorators' => array('ViewHelper')
        ));

        $this->addElement('cancel', 'cancel', array(
            'label' => 'Cancel',
            'link' => true,
            'prependText' => Zend_Registry::get('Zend_Translate')->_(' or '),
            'href' => '',
            'onclick' => 'parent.Smoothbox.close();',
            'decorators' => array(
                'ViewHelper'
            )
        ));
        $this->addDisplayGroup(array('submit', 'cancel'), 'buttons');
        $button_group = $this->getDisplayGroup('buttons');

        // Set default action
        $this->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));
    }
}

?>
